//交易页
import {reqAddressInfo,reqOrderInfo} from "@/api"
const state = {
    address:[],
    orderInfo:{}
}
const mutations = {
    //获取用户地理信息
    GETUSERADDRESS(state,address){
        state.address = address;
    },
    //获取商品订单
    ORDERINFO(state,orderInfo){
      state.orderInfo = orderInfo;
    }  
}
const actions = {
    //获取用户地理信息
  async addressInfo({commit}){
    let  result = await reqAddressInfo();
   if(result.code==200){
      commit("GETUSERADDRESS",result.data)
   }
  },
  //获取商品订单
  async orderInfo({commit}){
      let result = await reqOrderInfo();
      if(result.code==200){
          commit("ORDERINFO",result.data)
      }
  }
}
const getters = {

}
export default {
    state,
    mutations,
    actions,
    getters
}